$.ajax({
    type:'get',
    url:'/select',
    dataType:'json',
    data:{},
    success:function (data) {

        $.each(data,function (index,obj) {
            if(obj['seatInfo']['seatA'] == 0){
                $('.table-seat').eq(index).find('.seatA').find('img').css('background','#fff')

            } else if (obj['seatInfo']['seatA'] == 1){
                $('.table-seat').eq(index).find('.seatA').find('img').css('background-color','#B1B1FF')
            } else if (obj['seatInfo']['seatA'] == 2){
                $('.table-seat').eq(index).find('.seatA').find('img').css('background-color','#D9FF49')
            }
            if(obj['seatInfo']['seatB'] == 0){
                $('.table-seat').eq(index).find('.seatB').find('img').css('background-color','#fff')
            } else if (obj['seatInfo']['seatB'] == 1){
                $('.table-seat').eq(index).find('.seatB').find('img').css('background-color','#B1B1FF')
            } else if (obj['seatInfo']['seatB'] == 2){
                $('.table-seat').eq(index).find('.seatB').find('img').css('background-color','#D9FF49')
            }
            if(obj['seatInfo']['seatC'] == 0){
                $('.table-seat').eq(index).find('.seatC').find('img').css('background-color','#fff')
            } else if (obj['seatInfo']['seatC'] == 1){
                $('.table-seat').eq(index).find('.seatC').find('img').css('background-color','#B1B1FF')
            } else if (obj['seatInfo']['seatC'] == 2){
                $('.table-seat').eq(index).find('.seatC').find('img').css('background-color','#D9FF49')
            }
            if(obj['seatInfo']['seatD'] == 0){
                $('.table-seat').eq(index).find('.seatD').find('img').css('background-color','#fff')
            } else if (obj['seatInfo']['seatD'] == 1){
                $('.table-seat').eq(index).find('.seatD').find('img').css('background-color','#B1B1FF')
            } else if (obj['seatInfo']['seatD'] == 2){
                $('.table-seat').eq(index).find('.seatD').find('img').css('background-color','#D9FF49')
            }
        })
    },
    error:function () {
        alert("请求信息失败");
    }
});